package edu.ynu.se.xiecheng.achitectureclass.project.po.entity;


import com.fasterxml.jackson.annotation.JsonBackReference;
import edu.ynu.se.xiecheng.achitectureclass.common.entity.LogicEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;


@Entity
@Getter
@Setter
@Table(name = "SoilPhData")
public class SoilPHData extends LogicEntity {

    @Column(name = "name")
    private String name;

    @Column(name = "value", nullable = false)
    private Double value; // PH 值

    @Column(name = "timestamp", nullable = false)
    private Date timestamp; // 数据采集时间

    @Column(name = "unit")
    private String unit; // 单位，例如 mg/kg

    @JsonBackReference
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "device_id", nullable = false)
    private Device device; // 所属设备


}


